# -*- coding: utf-8 -*-
# @Time : 2023/12/1 19:23
# @Author : 支晓光
# @Email : 1473858993@qq.com
# @File : competition.py
# @Project : YouGuuUII
from time import sleep

from appium.webdriver.common.appiumby import AppiumBy

from common.appium_driver import driver
from common.base_page import BasePage


class Competition(BasePage):
    # 点击确定
    btn_submit = AppiumBy.ID,'com.jhss.youguu:id/btn_submit'
    # toast断言
    Toast = AppiumBy.XPATH,'//android.widget.Toast[@text="请输入正确的参赛邀请码"]'
    def to_competition(self):
        sleep(2)
        # 点击比赛
        self.tap(942, 171)
        sleep(1)
        # 点击邀请码输入框
        self.tap(359, 700)
        # 输入邀请码
        driver.press_keycode(8)
        driver.press_keycode(8)
        driver.press_keycode(8)
        driver.press_keycode(8)
        # 点击提交
        self.click_ele(self.btn_submit)
        self.status = self.find_element(self.Toast).text

# 请输入正确的参赛邀请码

